package com.mezz.bones.framework.payment.domain.enums;

public enum PayResponseEnum {

    SUCCESS("支付成功"),
    DUPLICATED("重复的支付订单id"),
    FAIL("失败"),
    NOT_PAID("订单未支付"),
    PENDING("订单支付中"),
    REFUNDED("订单全部或部分退款"),
    CLOSED("支付订单关闭"),
    TIMEOUT("支付订单超时"),
    NOTFOUND("支付订单不存在"),

    OVER("");


    PayResponseEnum(String desc) {
        this.desc = desc;
    }

    private String desc;

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static PayResponseEnum getInstance(String name){

        for (PayResponseEnum value : PayResponseEnum.values()) {

            if(value.name().equals(name)){
                return value;
            }
        }
        return null;
    }
}
